package com.example.orderboot.controller;

import com.example.orderboot.pojo.Order;
import com.example.orderboot.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.Date;

/**
 * @Authther: mrwu
 * @date:2021/6/7-06
 * @Description:com.example.orderboot.controller
 */
@RestController
public class OrderController {
    @Autowired
    OrderService orderService;

    @Transactional
    @PostMapping("/order")
    public void createOrder(){
        Order order = new Order();
        int a =1/0;
        order.setMoney(100);
        orderService.save(order);
    }
}
